<?php

namespace App\Http\Controllers\IndexManage;

use App\Biji;
use App\Http\Controllers\Controller;

class BijiController extends Controller
{
	/**
	 * @return array
	 */
    public function biji(){
    	$user_id = session('user_id');
    	if($user_id){
			$bijis_sort = empty($_GET['bijis_sort']) ?  'earliest_created' : $_GET['bijis_sort'];
			$bijis = Biji::get_bijis_by_user_id($user_id, $bijis_sort);
			return $this->successResponse('success', $bijis);
		}else{
    		return $this->failResponse(trans('session_fail'));
		}
    }
}
